package com.yilin.medical.adapter;

import com.yilin.medical.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class GridAdapter extends BaseAdapter {
	private Context context;
	private int[] imageId;
	
	
	public GridAdapter(Context context, int[] imageId) {
		super();
		this.context = context;
		this.imageId = imageId;
	}


	@Override
	public int getCount() {
		return imageId.length;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view = View.inflate(context,
				R.layout.griditem_home_, null);
		ImageView iv_icon = (ImageView) view.findViewById(R.id.iv_home);

		iv_icon.setImageResource(imageId[position]);

		return view;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

}
